package org.vergil.core.designpattern.mediator;

/**
 * Created by vergil on 17-3-24.
 */

//抽象组件类：抽象同事类
abstract class Component {
    protected Mediator mediator;
    protected String arg;

    public void setArg(String arg) {
        this.arg = arg;
    }

    public void setMediator(Mediator mediator) {
        this.mediator = mediator;
    }

    //转发调用
    public void changed() {
        mediator.componentChanged(this);
    }

    public abstract void update(String arg);
}
